package auction.chapter12;

import java.util.HashSet;
import java.util.Set;

public class CategoryChapter12 {
	private Long id;
	private String name;
	private CategoryChapter12 parent;
	private Set<CategoryChapter12> childCategories = new HashSet<CategoryChapter12>();
	
	public CategoryChapter12(){
		
	}
	
	public CategoryChapter12(String name){
		this.name = name;
	}
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public CategoryChapter12 getParent() {
		return parent;
	}
	public void setParent(CategoryChapter12 parent) {
		this.parent = parent;
	}
	public Set<CategoryChapter12> getChildCategories() {
		return childCategories;
	}
	public void setChildCategories(Set<CategoryChapter12> childCategories) {
		this.childCategories = childCategories;
	}
	
	public void addSon(CategoryChapter12 son){
		son.setParent(this);
		this.childCategories.add(son);
	}
	
}
